/* 
 * Adds picture content to the sections defined based on values given from the config.js
 *
 * @param picStart Is the numerical value given by the config file that notes the first file in the image directory to be displayed.
 * @param picEnd Is the numerical value given by the config file that notes the last file in the image directory to be displayed.
 * @param picFolder Is the name of the folder where the images that are being added are stored.
 * @param picName Is the naming convention used by all the images in the folder (only differing in number given after).
 * @param section Is the section which the contents are being added to.
 * @param picLabel Is the label which will appear above the content for the section followed by the number entry.
 *
 * @author Kendyll Doi, Paul Galiza, Edward Meyer, Jarrett Mizo
 */
function addPicContent(picStart, picEnd, picFolder, picName, section, picLabel) {

// Initializes an array to hold the question of numbers 
// based on the defined range given from the config.txt.
var picNumbers = new Array();

// Creates the sequence.
picNumbers = makeSequenceArray(picStart, picEnd);

  //Adds the images to the contents of the section given based on the generated Array.
  if(picNumbers[0] != 0){

    // Adds contents based on each number in the array.
    for(k = 0; k < picNumbers.length; k++) {

      // Adds content as a picture type and includes the necessary HTML tags.
      section.addContent('pic', picFolder + '/' + picName + picNumbers[k] + '.jpg', picLabel+(k+1));
    }
  } 
}

// Uses the function to add pictures to the configured sections.
addPicContent( sec2ImageStart, sec2ImageEnd, folderName2, imageName2, section2, labelName2);
addPicContent( sec3ImageStart, sec3ImageEnd, folderName3, imageName3, section3, labelName3);
addPicContent( sec4ImageStart, sec4ImageEnd, folderName4, imageName4, section4, labelName4);

// Shuffles the contents of the sections so they do not appear to be all pictures then all visualizations.
shuffle(section1);
shuffle(section2);
shuffle(section3);
shuffle(section4);

